import request from '../utils/request'

// 分销商提现审核列表
export function getWithDrawList(params) {
  return request({
    method: 'get',
    url: '/api/PCApplet/GetAgentCashOutRecord_Admin',
    params,
  })
}

// 分销商提现审核
export function CashOutRecordBySubmit(data) {
  return request({
    method: 'post',
    url: '/api/PCApplet/CashOutRecordBySubmit',
    data,
  })
}

// 分销商审核
export function updateCheck(data) {
  return request({
    method: 'post',
    url: '/API/PC_AgentExamine/UpdateState',
    data,
  })
}

// 分销商审核列表
export function getCheckList(params) {
  return request({
    method: 'get',
    url: '/API/PC_AgentExamine/PageList',
    params,
  })
}

// 分销代理树形列表
export function getAgentTree(params) {
  return request({
    method: 'get',
    url: '/api/Agent/AgentTree',
    params,
  })
}

// 获取小程序二维码
export function getAgentCode(params) {
	return request({
		url: '/api/Agent/AgentCode?agentid=' + params.agentId,
		method: 'GET',
	})
}

// 获取小程序短链接
export function getShortLink(params) {
	return request({
		url: '/api/Agent/ShortLink?agentid=' + params.agentId,
		method: 'GET',
	})
}

//获取主体公司
export function getCompanyList(params) {
  return request({
    method: 'get',
    url: '/api/Agent/GetCompanyList',
    params,
  })
}

// 添加分销
export function creatAgent(data) {
  return request({
    method: 'post',
    url: '/api/Agent/Add',
    data,
  })
}

// 修改分销
export function updateAgent(data) {
  return request({
    method: 'put',
    url: '/api/Agent/Update',
    data,
  })
}

// 删除分销
export function delAgent(params) {
  return request({
    method: 'delete',
    url: '/api/Agent/Delete',
    params,
  })
}

// 获取编辑数据
export function getEditData(params) {
  return request({
    method: 'get',
    url: '/api/Agent/Get',
    params,
  })
}

//添加分销公司
export function creatAgentCustom(data) {
  return request({
    method: 'post',
    url: '/api/AgentCustom/Add',
    data,
  })
}

//分销公司列表
export function getAgentCustomList(params) {
  return request({
    method: 'get',
    url: '/api/AgentCustom/PageList',
    params,
  })
}

//根据代理商ID获取公司下所有客户列表
export function getUserByCompanyId(data) {
  return request({
    method: 'post',
    url: '/api/Agent/GetUserByCompanyId_Page',
    data,
  })
}

//删除分销公司
export function delAgentCustom(params) {
  return request({
    method: 'delete',
    url: '/api/AgentCustom/Delete',
    params,
  })
}

//获取客户公司
export function getAgentCompanyList(params) {
  return request({
    method: 'get',
    url: '/api/AgentCustom/GetCompanyList',
    params,
  })
}